package com.csdemos.algs.function;

public class QuadraticResearch implements ResearchFunction{
	
	private static final int C1 = 1;
	private static final int C2 = 3;
    
    protected HashFunction hashFunction;

    public QuadraticResearch(HashFunction hashFunction) {
        this.hashFunction = hashFunction;
    }
    
    @Override
    public int next(int key, int i){
        return (hashFunction.hash(key) + C1*i * C2*i*i) % m;
    }
    
}
